package org.jground.rx.def.apps.accounting;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class WorkTimeEntry extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.accounting.WorkTimeEntry";

    private static final String time ="time";
    private static final String date ="date";
    private static final String costCenter ="costCenter";
    private static final String activityType ="activityType";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String time ="time";
        public static final String date ="date";
        public static final String costCenter ="costCenter";
        public static final String activityType ="activityType";
        public static final String $CREATOR ="$CREATOR";
    }

    public static WorkTimeEntry createNew() { return new WorkTimeEntry(RXObjectService.getInstance().create(moid)); }

    public static WorkTimeEntry getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new WorkTimeEntry(mod);
    }

    public static WorkTimeEntry[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        WorkTimeEntry[] res = new WorkTimeEntry[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new WorkTimeEntry(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static WorkTimeEntry[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static WorkTimeEntry[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        WorkTimeEntry[] res = new WorkTimeEntry[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new WorkTimeEntry(mod);
            i++;
        }
        return res;
    }

    public static WorkTimeEntry wrap(IRXObjectSynopsis mod) { 
        return new WorkTimeEntry(mod);
    }

    private WorkTimeEntry(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getTimeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, time).getLabel();
    }

    public static String getTimeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, time).getDescription();
    }

    public void setTime(Double doubleValue) {
        rxObject.set(time, _to_String(doubleValue));
    }

    public Double getTime() {
        return _to_Double(rxObject.getCurrentValue(time));
    }

    public static String getDateLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, date).getLabel();
    }

    public static String getDateDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, date).getDescription();
    }

    public void setDate(String dateValue) {
        rxObject.set(date, _to_String(dateValue));
    }

    public String getDate() {
        return _to_String(rxObject.getCurrentValue(date));
    }

    public static String getCostCenterLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, costCenter).getLabel();
    }

    public static String getCostCenterDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, costCenter).getDescription();
    }

    public void setCostCenter(org.jground.rx.def.apps.accounting.CostCenter value) {
        rxObject.set(costCenter, _to_String(value));
    }

    public org.jground.rx.def.apps.accounting.CostCenter getCostCenter() {
        return org.jground.rx.def.apps.accounting.CostCenter.getById(rxObject.getCurrentValue(costCenter));
    }

    public static String getActivityTypeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, activityType).getLabel();
    }

    public static String getActivityTypeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, activityType).getDescription();
    }

    public void setActivityType(org.jground.rx.def.apps.accounting.ActivityType value) {
        rxObject.set(activityType, _to_String(value));
    }

    public org.jground.rx.def.apps.accounting.ActivityType getActivityType() {
        return org.jground.rx.def.apps.accounting.ActivityType.getById(rxObject.getCurrentValue(activityType));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
